<head>
    <meta charset = "UTF-8">
    <title>我的植物检测平台</title>
    <link rel = "stylesheet" href="{{ url_for('static', filename='css/index.css') }}" type="text/css">
    <script src = "{{ url_for('static', filename='js/index.js') }}" ></script>
</head>

<body>
    <h1 class = "title">我的植物检测平台</h1>

    <div></div>

    <div class = "username">用户id：{{ESP32.id}}</div>

    <div>湿度：{{ESP32.moist}}%</div>
    <div>光照：{{ESP32.light}}%</div>
    <div>温度：{{ESP32.tmpre}}°C</div>

    <div>湿度控制：
    {% if ESP32.moist_s %}
        开启
    {% else %}
        关闭
    {% endif %}
    </div>

    <form action="/ctrl/moist" method="post">
        <input type = "submit" onclick = "moist_ctrl()" value="修改湿度">
    </form>

    <div>光照控制：
    {% if ESP32.light_s %}
        开启
    {% else %}
        关闭
    {% endif %}
    </div>

    <form action="/ctrl/light" method="post">
        <input type = "submit" onclick = "light_ctrl()" value="修改光照">
    </form>

    <div>温度控制：
    {% if ESP32.tmpre_s %}
        开启
    {% else %}
        关闭
    {% endif %}
    </div>

    <form action="/ctrl/tmpre" method="post">
        <input type = "submit" onclick = "tmpre_ctrl()" value="修改温度">
    </form>

    <div>自动控制：
    {% if ESP32.auto %}
        开启
    {% else %}
        关闭
    {% endif %}
    </div>

    <form action="/ctrl/auto" method="post">
        <input type = "submit" onclick = "auto_ctrl()" value="自动控制开关">
    </form>
</body>